package Chapter03;

import java.util.Scanner;

public class zuoye5 {
    //5.一家商店出售的钢管长度为3米,不切割零卖,顾客给出要求购买的长度,写程序计算需要买多少根？
    public static void main(String[] args) {
        int b = 0;
        int num = 3;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要购买的长度");
        int a = sc.nextInt();
        b = a / num;
        if (a % num != 0) {
            System.out.println(b + 1);
        } else {
            System.out.println(a / num);
        }
    }
}
